#include <bits/stdc++.h>
using namespace std;

const int N = 1000000 + 50;

vector<int> G[N], G2[N];

int n, m;

int u[N << 2], v[N << 2];

struct ios {
    inline char read(){
        static const int IN_LEN=1<<18|1;
        static char buf[IN_LEN],*s,*t;
        return (s==t)&&(t=(s=buf)+fread(buf,1,IN_LEN,stdin)),s==t?-1:*s++;
    }

    template <typename _Tp> inline ios & operator >> (_Tp&x){
        static char c11,boo;
        for(c11=read(),boo=0;!isdigit(c11);c11=read()){
            if(c11==-1)return *this;
            boo|=c11=='-';
        }
        for(x=0;isdigit(c11);c11=read())x=x*10+(c11^'0');
        boo&&(x=-x);
        return *this;
    }

    int read(char *s) {
        int len = 0;
        char ch;
        for (ch=read(); ch=='\n' || ch == ' '; ch=read());
        if (ch == -1) {
            s[len] = 0;
            return -1;
        }
        for (; ch!='\n' && ch != ' ' && ch != -1;ch=read())
            s[len++] = ch;
        s[len] = 0;
        return len;
    }
} io;

const int MOD = 19260817;

namespace simplecc {
    int fa[N], dep[N];

    int bl[N], B;

    bool vis[N];

    void init(int n) {
        B = 0;
        memset(dep, 0, sizeof(int) * (n + 1));
        memset(bl, 0, sizeof(int) * (n + 1));
    }

    void get(int x, int y) {
        if (dep[x] < dep[y]) return;
        bl[y] = ++B; vis[B] = 1;
        for (; x!=y; x=fa[x]) bl[x] = B;
    }

    void dfs(int u, int f) {
        fa[u] = f;
        dep[u] = dep[f] + 1;

        for (int v : G[u]) {
            if (v == f) continue;
            if (dep[v]) get(u, v);
            else dfs(v, u);
        }
    }

    void go(int n) {
        init(n);
        dfs(0, 0);
        for (int i=0; i<n; ++i) {
            if (!bl[i]) bl[i] = ++B;
        }

        for (int i=0; i<n; ++i) {
            for (int j : G[i]) {
                int u = bl[i], v = bl[j];
                if (u != v) G2[u].push_back(v);
            }
        }
    }
}

namespace treedp {
    vector<int> *G;
    int ans;
    int dp[N];
    void dfs(int u, int f) {
        int t = simplecc::vis[u] + 1;
        dp[u] = simplecc::vis[u];
        for (int v : G[u]) {
            if (v == f) continue;
            dfs(v, u);
            ans = (ans + 1LL*dp[u] * dp[v]) % MOD;
            dp[u] = (dp[u] + t * dp[v]) % MOD;
        }
    }

    int go(int n, vector<int> *pG) {
        G =pG;
        ans = 0;
        dfs(1, 0);
        return ans;
    }
}


int main(int argc, char const *argv[])
{
    // scanf("%d%d", &n, &m);
    io >> n >> m;
    for (int i=0; i<m; ++i) {
        // scanf("%d%d", &u[i], &v[i]);
        io >> u[i] >> v[i];
        --u[i]; --v[i];
        G[u[i]].push_back(v[i]);
        G[v[i]].push_back(u[i]);
    }
    simplecc::go(n);
    int ans = treedp::go(n, G2);
    ans = (ans % MOD + MOD) % MOD;
    printf("%d\n", ans);
    return 0;
}
